package com.chzc.fm.duotin.ui.home.utils;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/7/2.
 */
public class HomePlayListData {


    /**
     * total_page : 1
     * page : 1
     * page_size : 100
     * sort_type : 1
     */

    private PageBean page;
    /**
     * page : {"total_page":1,"page":1,"page_size":100,"sort_type":1}
     * data_list : []
     */

    private List<HomePalyListDataList> data_list;

    public static HomePlayListData objectFromData(String str) {

        return new Gson().fromJson(str, HomePlayListData.class);
    }

    public static List<HomePlayListData> arrayHomePlayListDataFromData(String str) {

        Type listType = new TypeToken<ArrayList<HomePlayListData>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public PageBean getPage() {
        return page;
    }

    public void setPage(PageBean page) {
        this.page = page;
    }

    public List<HomePalyListDataList> getData_list() {
        return data_list;
    }

    public void setData_list(List<HomePalyListDataList> data_list) {
        this.data_list = data_list;
    }

    public static class PageBean {
        private int total_page;
        private int page;
        private int page_size;
        private int sort_type;

        public static PageBean objectFromData(String str) {

            return new Gson().fromJson(str, PageBean.class);
        }

        public static List<PageBean> arrayPageBeanFromData(String str) {

            Type listType = new TypeToken<ArrayList<PageBean>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }

        public int getTotal_page() {
            return total_page;
        }

        public void setTotal_page(int total_page) {
            this.total_page = total_page;
        }

        public int getPage() {
            return page;
        }

        public void setPage(int page) {
            this.page = page;
        }

        public int getPage_size() {
            return page_size;
        }

        public void setPage_size(int page_size) {
            this.page_size = page_size;
        }

        public int getSort_type() {
            return sort_type;
        }

        public void setSort_type(int sort_type) {
            this.sort_type = sort_type;
        }
    }
}
